import { ref, onMounted, h, computed } from "vue";
import { NIcon } from "naive-ui";
import {
  BookOutline as BookIcon,
  PersonOutline as PersonIcon,
  WineOutline as WineIcon,
} from "@vicons/ionicons5";

const renderIcon = (icon) => {
  return () => h(NIcon, null, { default: () => h(icon) });
};

export const menuOptions = [
  {
    label: "工作台",
    name: "Home",
    key: "/home",
    icon: renderIcon(BookIcon),
    show: true,
  },
  {
    label: "系统管理",
    name: "System",
    key: "/system",
    icon: renderIcon(BookIcon),
    disabled: false,
    children: [
      {
        label: "公告管理",
        name: "Notice",
        key: "/system/notice",
        icon: renderIcon(BookIcon),
      },
      {
        label: "日志管理",
        name: "Log",
        key: "/system/log",
        icon: renderIcon(BookIcon),
      },
    ],
  },
  {
    label: "权限管理",
    name: "Permission",
    key: "/permission",
    icon: renderIcon(BookIcon),
    disabled: false,
    children: [
      {
        label: "用户管理",
        name: "User",
        key: "/permission/user",
        icon: renderIcon(BookIcon),
      },
      {
        label: "角色管理",
        name: "Role",
        key: "/permission/role",
        icon: renderIcon(BookIcon),
      },
      {
        label: "菜单管理",
        name: "Menu",
        key: "/permission/menu",
        icon: renderIcon(BookIcon),
      },
    ],
  },
  {
    label: "异常页",
    name: "Exception",
    key: "/exception",
    icon: renderIcon(BookIcon),
    disabled: false,
    children: [
      {
        label: "403",
        name: "403",
        key: "/exception/403",
        icon: renderIcon(BookIcon),
      },
      {
        label: "404",
        name: "404",
        key: "/exception/404",
        icon: renderIcon(BookIcon),
      },
      {
        label: "500",
        name: "500",
        key: "/exception/500",
        icon: renderIcon(BookIcon),
      },
    ],
  },
  {
    label: "多级菜单",
    name: "MultiLevelMenu",
    key: "多级菜单",
    icon: renderIcon(BookIcon),
    children: [
      {
        label: "菜单1",
        name: "MenuOne",
        key: "菜单1",
        icon: renderIcon(PersonIcon),
        children: [
          {
            label: "菜单1-1",
            name: "MenuOne-one",
            key: "菜单1-1",
            icon: renderIcon(PersonIcon),
          },
          {
            label: "菜单1-2",
            name: "MenuOne-two",
            key: "菜单1-2",
            icon: renderIcon(PersonIcon),
          },
        ],
      },
    ],
  },
  {
    label: "插件示例",
    name: "Plugins",
    key: "/plugins",
    icon: renderIcon(BookIcon),
    disabled: false,
    children: [
      {
        label: "剪贴板",
        name: "Cut",
        key: "/plugins/cut",
        icon: renderIcon(BookIcon),
      },
      {
        label: "图表",
        name: "Chart",
        key: "/exception/chart",
        icon: renderIcon(BookIcon),
      },
    ],
  },
];
